function getFormValues($form)
{
	//取得Form对象
	switch (typeof($form))
	{
		case 'object' :
			var $formObj = $form;
			break;
		case 'string' :
			var $formObj = document.getElementById($form);
			break;
	}

	var $result = new Object();	//结果
	var $reg = /^[^\[\]]*(\[([^\[\]]*)\])+$/;

	//取得所有的Form元素
	var $nodes = $formObj.elements;
	for($i=0; $i<$nodes.length; $i++)
	{
		var $temp = new Array();	//临时数据
		var $obj = $nodes[$i];
		var $tagName = $obj.tagName;
		var $type = $obj.type;
		var $name = $obj.name;

		if(!$name)	//没有名称不操作
		{
			continue;
		}

		//文本区域
		if($tagName == 'TEXTAREA')
		{
			$temp.push(new Array($name,$obj.value))
		}

		//下拉列表
		else if($tagName == 'SELECT')
		{
			var $option = $obj.options;

			for(var $j=0; $j<$option.length; $j++)
			{
				if($option[$j].selected == true)
				{
					$temp.push(new Array($name,$option[$j].value))
				}
			}
		}

		//Input标签
		else if($tagName == 'INPUT')
		{
			//文本域、密码域、隐藏域、按钮域
			if($type=='text' || $type=='password' || $type=='hidden' || $type=='button' || $type=='submit' || $type=='image' )
			{
				$temp.push(new Array($name,$obj.value))
			}

			//单选域
			if($type == 'radio' && $obj.checked == true)
			{
				$temp.push(new Array($name,$obj.value))
			}
			
			//多选域
			if($type == 'checkbox' && $obj.checked == true)
			{
				$temp.push(new Array($name,$obj.value))
			}
		}

		//格式化处理结果
		if($temp)
		{
			for($key1 in $temp)
			{
				var $name = $temp[$key1][0];
				var $value = $temp[$key1][1];

				//去除首尾空白
				while ($name.substring(0,1) == ' ')
				{
					$name = $name.substring(1, sString.length);
				}
				while ($name.substring($name.length-1, $name.length) == ' ')
				{
					$name = $name.substring(0,$name.length-1);
				}

				//数组
				$array_key = new Array();
				$array = new Array();
				do
				{
					$is_array = $name.match($reg);
					if($is_array)
					{
						$array_key.push($is_array[2]);
						$name = $name.replace($is_array[1],'');
					}
				}
				while($is_array);

				if($array_key)	//是数组或对象
				{
					while($array_key.length > 0)
					{
						$array.push($array_key.pop());
					}
				}

				if($array.length == 0)	//不是数组或对象，当字符串处理
				{
					$result[$name] = $value;
				}
				else	//是数组或对象
				{
					//创建空对象与数组
					for(var $j=0; $j<$array.length; $j++)
					{
						if($j==0 && typeof($result[$name]) != 'object')
						{
							if($array[$j])	//第一维是对象
							{
								$result[$name] = new Object();
							}
							else	//第一维是数组
							{
								$result[$name] = new Array();
							}
						}
						
						var $eval = '';
						var $var = '$result[$name]';	
						for(var $k=0; $k<=$j; $k++)
						{
							var $offset = $k+1;
							if(typeof($array[$offset]) != 'undefined')
							{
								$var += '[$array['+$k+']]';

								if($k == $j)	//最后一圈，创建空对象或数组
								{
									if($array[$offset])	//对象
									{									
										$eval = "if(typeof("+$var+") != 'object') {"+$var+" = new Object();}";
									}
									else	//数组
									{
										$eval = "if(typeof("+$var+") != 'object') {"+$var+" = new Array();}";

									}
								}
							}	
						}

						eval($eval);
					}

					//最后一维
					$j--;
					if($array[$j])	//对象
					{
						$eval = $var+"[$array["+$j+"]] = $value";
					}
					else	//数组
					{
						$eval = $var+".push($value)"
					}
					
					eval($eval);
				}				
			}
		}
	}
	return $result;

}